package cs3343.project.family;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class YesNoFrame extends JFrame{
	static String action = "";
	
	public YesNoFrame(Character character, Card card, String cardType) {
		
		String[] option = ToolCardFrame.availableCards(character, cardType);	
		
		action = (String)JOptionPane.showInputDialog(YesNoFrame.this,
			 card.description, cardType, JOptionPane.INFORMATION_MESSAGE, 
			 null, option,"None");
		 
		if(action == null)
			character.setEsteem(character.getEsteem() - 50);
		else if(action == "None")
			character.setEsteem(character.getEsteem() + 50);
		else{
			//TODO tool card function
		}
		
		
		// TODO: old version without combo box
		/*int answer = JOptionPane.showConfirmDialog(null, card.description, cardType, JOptionPane.OK_CANCEL_OPTION);

			if (answer == JOptionPane.OK_OPTION)
				character.setEsteem(character.getEsteem() + 50);
			else if (answer == JOptionPane.CANCEL_OPTION)
				character.setEsteem(character.getEsteem() - 50);*/
	}
}
